]> dgit.raspbian.org Git - libreoffice.git/commitdiff
[PATCH] Show infobar for calc graphics with remote content too
authorCaolán McNamara <caolan.mcnamara@collabora.com>
Wed, 1 Apr 2026 20:19:19 +0000 (20:19 +0000)
committerRene Engelhard <rene@debian.org>
Sat, 3 Oct 2026 10:46:08 +0000 (12:46 +0200)
Change-Id: I8ed0482344bb06afa6079540ea2a3854930da225
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2383
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 1f51bbee0e7661d5607efe2603c59d83f410dd3d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205492
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208405
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Gbp-Pq: Name Show-infobar-for-calc-graphics-with-remote-content-too.diff

sc/inc/documentlinkmgr.hxx
sc/source/ui/docshell/docsh4.cxx
sc/source/ui/docshell/documentlinkmgr.cxx
sc/source/ui/view/tabvwsh4.cxx

index de36ec40fa815c9e6d1841e6bd4e182f4019eeda..36369a5d04ba083e5dce50a206ea563462da8dd9 100644 (file)
@@ -53,7 +53,7 @@ public:
     bool idleCheckLinks();
 
     bool hasDdeLinks() const;
-    bool hasDdeOrOleOrWebServiceLinks() const;
+    bool hasExternalLinks() const;
     bool hasExternalRefLinks() const;
 
     bool updateDdeOrOleOrWebServiceLinks(weld::Window* pWin);
@@ -63,7 +63,7 @@ public:
     size_t getDdeLinkCount() const;
 
 private:
-    bool hasDdeOrOleOrWebServiceLinks(bool bDde, bool bOle, bool bWebService) const;
+    bool hasExternalLinks(bool bDde, bool bOle, bool bWebService, bool bGraphic) const;
 };
 
 }
index a00bf023c74c5c8df87e4d7782a5fafcb96d9be1..f9744533772a1e2136bd09c5a7a57e98eb1cd670 100644 (file)
@@ -25,6 +25,7 @@
 #include <editeng/flstitem.hxx>
 #include <sfx2/fcontnr.hxx>
 #include <sfx2/infobar.hxx>
+#include <sfx2/linkmgr.hxx>
 #include <sfx2/objface.hxx>
 #include <sfx2/docfile.hxx>
 #include <sfx2/docfilt.hxx>
@@ -203,6 +204,12 @@ void ScDocShell::ReloadAllLinks()
     }
 
     m_pDocument->UpdateAreaLinks();
+
+    // update linked graphics from the draw layer
+    if (sfx2::LinkManager* pLinkMgr = m_pDocument->GetDocLinkManager().getLinkManager(false))
+    {
+        pLinkMgr->UpdateAllLinks(false, false, nullptr, u""_ustr);
+    }
 }
 
 IMPL_LINK( ScDocShell, ReloadAllLinksHdl, weld::Button&, rButton, void )
index 0fb89cfa0d18237a23ddb730e62703cb76616926..d098631bc214c11e5511e8d583a815720795d198 100644 (file)
@@ -125,15 +125,15 @@ bool DocumentLinkManager::idleCheckLinks()
 
 bool DocumentLinkManager::hasDdeLinks() const
 {
-    return hasDdeOrOleOrWebServiceLinks(true, false, false);
+    return hasExternalLinks(true, false, false, false);
 }
 
-bool DocumentLinkManager::hasDdeOrOleOrWebServiceLinks() const
+bool DocumentLinkManager::hasExternalLinks() const
 {
-    return hasDdeOrOleOrWebServiceLinks(true, true, true);
+    return hasExternalLinks(true, true, true, true);
 }
 
-bool DocumentLinkManager::hasDdeOrOleOrWebServiceLinks(bool bDde, bool bOle, bool bWebService) const
+bool DocumentLinkManager::hasExternalLinks(bool bDde, bool bOle, bool bWebService, bool bGraphic) const
 {
     sfx2::LinkManager* pMgr = mpImpl->mpLinkManager;
     if (!pMgr)
@@ -149,6 +149,8 @@ bool DocumentLinkManager::hasDdeOrOleOrWebServiceLinks(bool bDde, bool bOle, boo
             return true;
         if (bWebService && dynamic_cast<ScWebServiceLink*>(pBase))
             return true;
+        if (bGraphic && pBase->GetObjType() == sfx2::SvBaseLinkObjectType::ClientGraphic)
+            return true;
     }
 
     return false;
index af8496c347b64a4fff23b3d3cc30f90df595e845..0e5abc8390e328486f73e4befd32052e528b05c3 100644 (file)
@@ -1632,7 +1632,7 @@ void ScTabViewShell::Construct( TriState nForceDesignMode )
             if (!bLink)
             {
                 const sc::DocumentLinkManager& rMgr = rDoc.GetDocLinkManager();
-                if (rDoc.HasLinkFormulaNeedingCheck() || rDoc.HasAreaLinks() || rMgr.hasDdeOrOleOrWebServiceLinks())
+                if (rDoc.HasLinkFormulaNeedingCheck() || rDoc.HasAreaLinks() || rMgr.hasExternalLinks())
                     bLink = true;
             }
             if (bLink)